package com.lili.collection.core.context;

import com.lili.collection.core.error.StageRecordException;
import com.lili.collection.core.record.Record;
import com.lili.collection.core.support.EnumFuncExtension;

/**
 * 阶段上下文
 *
 * @author lili
 * @date 2023/3/7 22:53
 * @description 阶段上下文
 */
public interface StageContext {

    enum StageContextState implements EnumFuncExtension {
        CONTINUE,
        COMPLETE;
    }

    enum StageRecordState implements EnumFuncExtension {
        ALL_SUCCESS,
        SUCCESS_HAS_ERROR,
        ALL_ERROR;
    }

    /**
     * 顺序
     */
    int getIndex();

    void setIndex(int index);

    void setRecord(Record record);

    StageContextState getStageContextState();

    void setStageContextState(StageContextState stageContextState);

    StageRecordState getStageRecordState();

    void setStageRecordState(StageRecordState stageRecordState);

    StageRecordException getException();

    void setException(StageRecordException exception);

    void clear();
}
